#pragma once

#include <Windows.h>
#include <xnamath.h>


namespace TestDX
{

class Light
{
public:
	Light(void);
	~Light(void);

	inline void SetAmbientColor(float, float, float, float);
	inline void SetDiffuseColor(float, float, float, float);
	inline void SetDirection(float, float, float);
	inline void SetSpecularColor(float, float, float, float);
	inline void SetSpecularPower(float);

	inline const XMFLOAT4 & GetAmbientColor() const;
	inline const XMFLOAT4 & GetDiffuseColor() const;
	inline const XMFLOAT3 & GetDirection() const;
	inline const XMFLOAT4 & GetSpecularColor() const;
	inline float GetSpecularPower() const;

private:
	// Copy and assign are forbidden
	Light(const Light &);
	Light & operator=(const Light &);

	// Attribs
	XMFLOAT4 _ambientColor;
	XMFLOAT4 _diffuseColor;
	XMFLOAT3 _direction;
	XMFLOAT4 _specularColor;
	float _specularPower;
};

void Light::SetAmbientColor(float r, float g, float b, float a)
{
	_ambientColor = XMFLOAT4(r, g, b, a);
}

void Light::SetDiffuseColor(float r, float g, float b, float a)
{
	_diffuseColor = XMFLOAT4(r, g, b, a);
}

void Light::SetDirection(float x, float y, float z)
{
	_direction = XMFLOAT3(x, y, z);
}

void Light::SetSpecularColor(float r, float g, float b, float a)
{
	_specularColor = XMFLOAT4(r, g, b, a);
}
void Light::SetSpecularPower(float p)
{
	_specularPower = p;
}

const XMFLOAT4 & Light::GetAmbientColor() const { return _ambientColor; }
const XMFLOAT4 & Light::GetDiffuseColor() const { return _diffuseColor; }
const XMFLOAT3 & Light::GetDirection() const { return _direction; }
const XMFLOAT4 & Light::GetSpecularColor() const { return _specularColor; }
float Light::GetSpecularPower() const { return _specularPower; }

}